.index {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #ffffff;
  position: relative;
  
  // 菜单遮罩层样式
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
  }
  
  // 侧边菜单样式
  .side-menu {
    position: fixed;
    top: 0;
    left: -75%;
    width: 75%;
    height: 100vh;
    background-color: #ffffff;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    
    &.visible {
      left: 0;
    }
    
    .menu-header {
      padding: 40px 20px;
      border-bottom: 1px solid #f0f0f0;
      display: flex;
      flex-direction: column;
      align-items: center;
      
      .user-avatar {
        width: 140px;
        height: 140px;
        border-radius: 70px;
        overflow: hidden;
        margin-bottom: 20px;
        
        .avatar-image {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }
      
      .user-name {
        font-size: 36px;
        font-weight: bold;
        color: #333;
      }
    }
    
    .menu-items {
      flex: 1;
      
      .menu-item {
        padding: 35px 20px;
        border-bottom: 1px solid #f5f5f5;
        
        Text {
          font-size: 32px;
          color: #333;
        }
        
        &:active {
          background-color: #f0f0f0;
        }
      }
    }
    
    // 装饰区域样式
    .menu-decoration {
      padding: 30px 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 15px;
      border-top: 1px solid #f0f0f0;
      margin-top: auto;
      margin-bottom: 20px;
      
      .decoration-text {
        font-size: 36px;
        font-weight: bold;
        color: #ff6b6b;
        letter-spacing: 1px;
      }
      
      .decoration-image {
        width: 80px;
        height: 80px;
        border-radius: 8px;
        object-fit: cover;
        filter: sepia(100%) saturate(200%) hue-rotate(320deg) brightness(1.2);
      }
    }
  }
  
  // 顶部导航栏
  .header {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    
    .menu-icon {
      width: 50px;
      height: 50px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      
      .menu-line {
        width: 28px;
        height: 3px;
        background-color: #333;
        margin: 3px 0;
      }
    }
    
    .header-title {
      display: flex;
      align-items: center;
      
      .app-name {
        font-size: 36px;
        font-weight: bold;
        color: #000;
      }
      
      .app-subtitle {
        font-size: 36px;
        color: #999;
        margin-left: 8px;
      }
      
      .dropdown-arrow {
        font-size: 24px;
        color: #999;
        margin-left: 4px;
      }
    }
    
    .full-screen-icon {
      width: 50px;
      height: 50px;
      display: flex;
      justify-content: center;
      align-items: center;
      
      .square {
        width: 28px;
        height: 28px;
        border: 2px solid #333;
        border-radius: 2px;
      }
    }
  }
  
  // 聊天内容区域
  .chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth; /* 平滑滚动 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    overscroll-behavior: contain; /* 防止滚动传播 */
    height: 100%;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* 丝滑过渡 */
    
    // 微信小程序需要
    &::-webkit-scrollbar {
      width: 0;
      background: transparent;
    }
    
    // 增强滚动体验
    scroll-snap-type: y proximity;
    will-change: scroll-position;
    
    // 下拉刷新区域样式优化
    &::before {
      content: '';
      position: absolute;
      top: -100px;
      left: 0;
      right: 0;
      height: 100px;
      background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%);
      pointer-events: none;
    }
    
    // 确保微信小程序的scroll-view
    :global {
      .taro_page {
        height: 100%;
      }
      
      .taro-scroll-view {
        height: 100%;
      }
    }
    
    // 加载更多提示
    .loading-more {
      text-align: center;
      padding: 30px 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      animation: fadeInUp 0.3s ease-out;
      
      .loading-spinner {
        width: 40px;
        height: 40px;
        border: 3px solid #f3f3f3;
        border-top: 3px solid #007AFF;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 15px;
      }
      
      Text {
        font-size: 28px;
        color: #666;
        font-weight: 500;
        animation: pulse 2s ease-in-out infinite;
      }
    }
    
    // 加载动画关键帧
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    @keyframes pulse {
       0%, 100% {
         opacity: 0.6;
       }
       50% {
         opacity: 1;
       }
     }
     
     @keyframes slideInMessage {
       from {
         opacity: 0;
         transform: translateY(15px) scale(0.95);
       }
       to {
         opacity: 1;
         transform: translateY(0) scale(1);
       }
     }
    
    // 没有更多历史记录提示
    .no-more-messages {
      text-align: center;
      padding: 20px 0;
      
      Text {
        font-size: 28px;
        color: #999;
      }
    }
    
    // 空聊天提示
    .empty-chat {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 200px;
      
      Text {
        font-size: 32px;
        color: #999;
      }
    }
    
    // 消息项样式
    .message-item {
      margin-bottom: 24px;
      display: flex;
      flex-direction: column;
      position: relative;
      animation: slideInMessage 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      transform-origin: center;
      will-change: transform, opacity;
      
      // 消息时间 - 移到上方
      .message-time {
        font-size: 26px;
        color: #999;
        margin-bottom: 6px;
        text-align: center;
      }
      
      // 消息内容
      .message-content {
        padding: 18px;
        border-radius: 16px;
        max-width: 80%;
        position: relative;
        
        Text {
          font-size: 32px;
          line-height: 1.5;
          word-break: break-word;
        }
      }
      
      // 情感标签
      .emotion-tag {
        position: absolute;
        bottom: -10px;
        right: 10px;
        padding: 6px 14px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        
        .emotion-text {
          font-size: 26px;
          color: #fff;
        }
        
        .emotion-score {
          font-size: 26px;
          color: #fff;
          margin-left: 4px;
          background-color: rgba(255, 255, 255, 0.2);
          border-radius: 50%;
          width: 34px;
          height: 34px;
          display: flex;
          align-items: center;
          justify-content: center;
        }
        
        &.emotion-positive {
          background-color: #4CAF50;
        }
        
        &.emotion-negative {
          background-color: #F44336;
        }
        
        &.emotion-neutral {
          background-color: #9E9E9E;
        }
      }
    }
    
    // 用户消息样式 - 在右边
    .user-message {
      align-items: flex-end;
      margin-right: 5%;
      
      .message-time {
        text-align: right;
        margin-right: 2%;
      }
      
      .message-content {
        background-color: #007AFF;
        color: #fff;
        align-self: flex-end;
        max-width: 75%;
        margin-right: 2%;
        word-break: break-all;
        
        Text {
          color: #fff;
        }
      }
    }
    
    // AI消息样式 - 在左边
    .ai-message {
      align-items: flex-start;
      margin-left: 5%;
      
      .message-time {
        text-align: left;
        margin-left: 2%;
      }
      
      .message-content {
        background-color: #F0F0F0;
        color: #333;
        align-self: flex-start;
        max-width: 75%;
        margin-left: 2%;
        
        Text {
          color: #333;
        }
      }
    }
  }
  
  // 底部输入区域
  .input-container {
    padding: 18px 20px;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    background-color: #fff;
    z-index: 10;
    
    .search-bar {
      display: flex;
      align-items: center;
      border: 1px solid #e0e0e0;
      border-radius: 48px;
      padding: 10px 18px;
      
      .voice-icon {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 12px;
        
        .icon-circle {
          display: block;
          width: 28px;
          height: 28px;
          background-color: #f0f0f0;
          border-radius: 50%;
          position: relative;
          
          &::after {
            content: '';
            display: block;
            width: 10px;
            height: 10px;
            background-color: #666;
            border-radius: 50%;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
          }
        }
      }
      
      .search-input {
        flex: 1;
        height: 42px;
        border: none;
        font-size: 32px;
        padding: 0 12px;
      }
      
      // 发送按钮容器
      .send-button-container {
        display: flex;
        align-items: center;
        margin-left: 10px;
        
        .send-button {
          height: 42px;
          padding: 0 16px;
          border-radius: 21px;
          background-color: #e9ecef;
          border: none;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 28px;
          color: #6c757d;
          transition: all 0.2s ease;
          min-width: 60px;
          
          &.active {
            background-color: #007aff;
            color: white;
            
            &:active {
              transform: scale(0.95);
              background-color: #0056cc;
            }
          }
          
          &:disabled {
            background-color: #e9ecef;
            color: #6c757d;
            opacity: 0.6;
          }
        }
      }
      
      // 语音按钮容器
      .voice-button-container {
        display: flex;
        align-items: center;
        margin-left: 10px;
        
        .voice-button {
          width: 50px;
          height: 50px;
          border-radius: 25px;
          background-color: #007aff;
          border: none;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 24px;
          color: white;
          transition: all 0.2s ease;
          
          &:active {
            transform: scale(0.95);
            background-color: #0056cc;
          }
          
          &.recording {
            background-color: #ff3b30;
            animation: pulse 1s infinite;
            
            &:active {
              background-color: #d70015;
            }
          }
          
          &:disabled {
            background-color: #c7c7cc;
            opacity: 0.6;
          }
        }
      }
      
      // 打断按钮样式
      .interrupt-button {
        background-color: #ff4757;
        border-radius: 22px;
        padding: 10px 18px;
        margin-right: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 70px;
        transition: all 0.2s ease;
        
        &:active {
          background-color: #ff3742;
          transform: scale(0.95);
        }
        
        .interrupt-text {
          color: #ffffff;
          font-size: 28px;
          font-weight: 500;
        }
      }
      
      .action-icons {
        display: flex;
        align-items: center;
        
        .plus-icon {
          font-size: 42px;
          color: #666;
          width: 42px;
          height: 42px;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 12px;
        }
        
        .r1-icon {
          font-size: 28px;
          color: #666;
          background-color: #f5f5f5;
          padding: 8px 14px;
          border-radius: 22px;
          margin-right: 12px;
        }
        
        .network-icon {
          font-size: 28px;
          color: #666;
          background-color: #f5f5f5;
          padding: 8px 14px;
          border-radius: 22px;
          margin-right: 12px;
        }
        
        .camera-icon {
          font-size: 36px;
          color: #666;
          width: 42px;
          height: 42px;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }
    }
    
    .ai-disclaimer {
      text-align: center;
      margin-top: 16px;
      
      Text {
        font-size: 28px;
        color: #999;
      }
    }
  }
  
  // 底部卡片区域
  .card-container {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 20px;
    
    .card {
      width: 30%;
      background-color: #f9f9f9;
      border-radius: 16px;
      padding: 18px;
      
      .card-title {
        font-size: 32px;
        font-weight: bold;
        color: #333;
        display: block;
        margin-bottom: 8px;
      }
      
      .card-content {
        font-size: 28px;
        color: #666;
        display: block;
        line-height: 1.3;
      }
    }
  }
}

// 添加消息内容样式优化
.message-content {
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
  
  // 确保链接正确显示
  a {
    color: #0366d6;
    text-decoration: none;
    
    &:hover {
      text-decoration: underline;
    }
  }
}

// 修改AI回复的字体样式 - 重要：增大AI消息字体
.ai-message {
  .message-content {
    font-size: 32px;
    letter-spacing: 0.02em;
  }
}

// 添加打字机效果样式
.typing {
  position: relative;
  
  &::after {
    content: '|';
    margin-left: 2px;
    font-weight: bold;
    color: #333;
    animation: blink 0.7s infinite;
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

// 语音按钮脉冲动画
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

// 语音识别状态提示样式
.voice-status {
  padding: 10px 20px;
  text-align: center;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  
  .voice-status-text {
    font-size: 28px;
    color: #007aff;
    font-weight: 500;
  }
}

// 语音播放按钮样式
.voice-play-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-right: 10px;
}

.voice-play-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;

  &:hover {
    background: #e8e8e8;
    transform: scale(1.05);
  }

  &:active {
    transform: scale(0.95);
  }

  &.playing {
    background: #007aff;
    border-color: #007aff;
    animation: pulse-play 1.5s infinite;

    .voice-play-icon {
      color: white;
    }
  }
}

.voice-play-icon {
  font-size: 16px;
  color: #666;
  transition: color 0.3s ease;
}

// 播放状态脉冲动画
@keyframes pulse-play {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 122, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
}

// 流式响应打字效果
.typing::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: #333;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

// 底部锚点元素样式
#bottom-anchor {
  height: 1px;
  margin-bottom: 20px;
  width: 100%;
  clear: both;
}

// 确保flex容器有明确高度
.index {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
